package Test;

import java.util.Scanner;

class Phone {
//    int brand=0;
//    int price=0;
//    char color=0;
//    public void call(){
//        System.out.println("打给某某");
//    }
//    public void sendMessage(){
//        System.out.println("请输入发送短信的内容");
//        Scanner reader=new Scanner(System.in);
//        String Message=reader.next();
//    }
//
//    public int getBrand() {
//        return brand;
//    }
//
//    public void setBrand(int brand) {
//        this.brand = brand;
//    }
//
//    public int getPrice() {
//        return price;
//    }
//
//    public void setPrice(int price) {
//        this.price = price;
//    }
//
//    public char getColor() {
//        return color;
//    }
//
//    public void setColor(char color) {
//        this.color = color;
//    }
//
//
//}
//public class Phoneuse {
//    public static void main(String[] args) {
//        Phone test1=new Phone();
//        test1.setColor('黑');
//        test1.setPrice(3998);
//        test1.setBrand(12);
//        System.out.println("价钱"+test1.price+"颜色"+test1.color+test1.brand);
//
//    }
//}

///*
//package com.cn;
//
//import java.util.Random;
//import java.util.Scanner;
//
//public class Rational {
//    int numerator = 1;
//    int denominator = 1;
//
//    public int Common_divisor(int a, int b) {
//        if (a == 0 || b == 0)
//            while (a != b) {
//                if (a > b)
//                    a -= b;
//                else b -= a;
//            }
//        return a;
//    }
//
//    public Rational add(Rational rational, Rational ra) {
//        System.out.println("加法运算");
//        Rational num = new Rational();
//        num.denominator = rational.denominator * ra.denominator;
//        num.numerator = rational.denominator * ra.numerator + rational.numerator * ra.denominator;
//        return num;
//    }
//
//    public Rational sub(Rational rational, Rational ra) {
//        System.out.println("减法运算");
//        Rational num = new Rational();
//        num.denominator = rational.denominator * ra.denominator;
//        num.numerator = rational.denominator * ra.numerator - rational.numerator * ra.denominator;
//        return num;
//    }
//
//
//    public Rational muti(Rational rational, Rational ra) {
//        System.out.println("乘法运算");
//        Rational num = new Rational();
//        num.denominator = rational.denominator * ra.denominator;
//        num.numerator = rational.denominator * ra.numerator;
//        return num;
//    }
//
//    public Rational div(Rational rational, Rational ra) {
//        System.out.println("除法运算");
//        Rational num = new Rational();
//        num.denominator = rational.denominator * ra.numerator;
//        num.numerator = rational.numerator * ra.denominator;
//        return num;
//    }
//}*/



 package pake1;

import java.util.Scanner;

    public class Test1 {
        public static void show() {
            System.out.println("1.创建一个圆");
            System.out.println("2.创建一个矩形");
            System.out.println("3.创建一个长方体");
            System.out.println("4.创建一个圆柱体");
            System.out.println("5.显示已经创建的图形");
            System.out.println("6.求各图形的面积之和");
            System.out.println("7.退出系统");
        }

        public static void main(String[] args) {
            System.out.println("***图形类对象的管理***");
            System.out.println("-----------------");
            System.out.println("1.创建一个圆");
            System.out.println("2.创建一个矩形");
            System.out.println("3.创建一个长方体");
            System.out.println("4.创建一个圆柱体");
            System.out.println("5.显示已经创建的图形");
            System.out.println("6.求各图形的面积之和");
            System.out.println("7.退出系统");
            Scanner cin = new Scanner(System.in);

            double sum = 0;
            int m1 = 0;
            int a = 0;
            int b = 0;
            int d = 0;
            int p = 0;
            while (m1 != 7) {
                m1 = cin.nextInt();
                switch (m1) {
                    case 1:
                        double r;
                        System.out.println("请输入半径：");
                        r = cin.nextDouble();
                        Circle y = new Circle(r);
                        sum += y.aera();
                        y.show();
                        a += 1;
                        show();
                        break;
                    case 2:
                        double c, k;
                        System.out.println("请分别输入长和宽：");
                        c = cin.nextDouble();
                        k = cin.nextDouble();

                        Rectangle jx = new Rectangle(c, k);
                        sum += jx.aera();
                        jx.show();
                        b += 1;
                        show();
                        break;
                    case 3:
                        double c1, k1, g1;
                        System.out.println("请分别输入长宽高：");
                        c1 = cin.nextDouble();
                        k1 = cin.nextDouble();
                        g1 = cin.nextDouble();
                }
            }
        }
    }

